#pragma once
#include <map>
class RenderView;
typedef std::map<std::string, std::string> NameValeParamMap;

class MovableObject
{
public:
	MovableObject(const std::string& name, Scene* owner);
	virtual ~MovableObject();
	
	inline const std::string& getName() const { return mName; }
	inline Scene* getOwner() const { return mOwner; }
	inline SceneNode* getParent() const { return mParent; }
	
	inline const AxisAlignedBox& getAABB() const { return mAABB; }
	inline const AxisAlignedBox& getWorldAABB() const { return mWorldAABB; }

	virtual const char* getMovableType() const = 0;

	inline bool getVisible() const { return mVisible; }
	virtual void setVisible(bool v) { mVisible = v; }
	
	virtual bool Init(const NameValeParamMap* params) { return true; }
	virtual void NotifyAttached(SceneNode* parent);
	virtual void AddToView(RenderView* view) {}
	virtual void UpdateTransform();

protected:
	const std::string mName;
	Scene* mOwner;
	SceneNode* mParent;
	AxisAlignedBox mAABB;
	AxisAlignedBox mWorldAABB;
	bool mVisible;
	
	virtual void AddToScene();
	virtual void RemoveFromScene();
};